<template>
	<div class="model">
		<h2 class="model__title">
			审核详情
			<span @click="close" class="model__title--close">&times;</span>
		</h2>
		<div class="model__content" v-loading="loading">
			<div v-if="data">
				<div class="item" v-if="data.reject_reason">
					<h2 class="item__title">驳回理由</h2>
					<div class="item__reason">
						{{data.reject_reason}}
					</div>
				</div>
				<div class="item">
					<div class="item__title">用户信息</div>
					<div class="item__detail">
						<div class="item__detail--title">手机号:</div>
						<div class="item__detail--value">{{data.member.mobile}}</div>
					</div>
					<div class="item__detail">
						<div class="item__detail--title">注册时间:</div>
						<div class="item__detail--value">{{data.member.regist_time | formatTime}}</div>
					</div>
					<br />
					<div class="item__detail">
						<div class="item__detail--title">真实姓名:</div>
						<div class="item__detail--value">{{data.member.real_name}}</div>
					</div>
					<div class="item__detail">
						<div class="item__detail--title">身份证号:</div>
						<div class="item__detail--value">{{data.member.id_no}}</div>
					</div>
				</div>
				<div class="item">
					<div class="item__title">身份证照片</div>
					<div>
						<div style="display: inline-block; padding: 0 20px;">
							<img :src="data.member.idcard1" style="max-width: 200px; max-height: 200px;"/>
						</div>
						<div style="display: inline-block; padding: 0 20px;">
							<img :src="data.member.idcard2" style="max-width: 200px; max-height: 200px;"/>
						</div>
					</div>
				</div>
				<div class="item">
					<div class="item__title">申请信息</div>
					<div class="item__detail">
						<div class="item__detail--title">申请日期:</div>
						<div class="item__detail--value">{{data.ask_time | formatTime}}</div>
					</div>
					<div class="item__detail">
						<div class="item__detail--title">申请理由:</div>
						<div class="item__detail--value">{{data.ask_reason}}</div>
					</div>
				</div>
				<div class="item">
					<div class="item__title">资质图片</div>
					<div v-for="ask_res in data.ask_res" style="display: inline-block; padding: 0 20px;">
						<img :src="ask_res.url" style="max-width: 200px; max-height: 200px;"/>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	export default {
		created(){
			this.fetchManagerDetail();
		},
		props: ["id", 'reason'],
		data() {
			return {
				loading: true,
				data: null
			}
		},
		methods: {
			close() {
				this.$parent.showModel = false;
			},
			fetchManagerDetail() {
				this.loading = true;
				var url = `${this.url}/spread/check_be_spreader_info.action`;
				var params = {
					token: "3960c4db11d44c018898258d63d95bd0",
					be_saleman_id: this.id
				};
				this.$http.get(url,{ params }).then((res)=> {
					this.loading = false;
					this.data = res.data.result;
				});
			}
		}
	}
</script>

<style lang="scss" scoped>

</style>